﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace 财务电子票存档工具
{
    public partial class FEBillQuery : Form
    {
        public FEBillQuery()
        {
            InitializeComponent();
            dataGridViewQueryResult.AutoGenerateColumns = false;
            ResetAll();
        }

        private Panel panel1;
        private TextBox textBoxSellerIdNum;
        private Label label2;
        private TextBox textBoxEIid;
        private ComboBox comboBoxTaxpayerType;
        private Label label6;
        private ComboBox comboBoxGeneralOrSpecialVAT;
        private Label label5;
        private ComboBox comboBoxInIssuType;
        private Label label4;
        private TextBox textBoxSellerName;
        private Label label3;
        private TextBox textBoxotalTaxAm;
        private Label label7;
        private Label label9;
        private Label label10;
        private TextBox textBoxTotalAmWithoutTax;
        private Label label8;
        private Button buttonReset;
        private DateTimePicker dateTimePickerEnd;
        private DateTimePicker dateTimePickerStar;
        private Button button1;
        private StatusStrip statusStrip1;
        private ToolStripStatusLabel TSStatusLabelRecCount;
        private Panel panelPageControl;
        private Label label11;
        private ComboBox comboBox1;
        private DataGridView dataGridViewQueryResult;
        private BindingSource eBillsSQLToolsBindingSource;
        private IContainer components;
        private Label label1;

        private void InitializeComponent()
        {
            components = new Container();
            ComponentResourceManager resources = new ComponentResourceManager(typeof(FEBillQuery));
            panel1 = new Panel();
            buttonReset = new Button();
            dateTimePickerEnd = new DateTimePicker();
            dateTimePickerStar = new DateTimePicker();
            label9 = new Label();
            label10 = new Label();
            textBoxTotalAmWithoutTax = new TextBox();
            label8 = new Label();
            textBoxotalTaxAm = new TextBox();
            label7 = new Label();
            comboBoxTaxpayerType = new ComboBox();
            label6 = new Label();
            comboBoxGeneralOrSpecialVAT = new ComboBox();
            label5 = new Label();
            comboBoxInIssuType = new ComboBox();
            label4 = new Label();
            textBoxSellerName = new TextBox();
            label3 = new Label();
            textBoxSellerIdNum = new TextBox();
            label2 = new Label();
            textBoxEIid = new TextBox();
            label1 = new Label();
            button1 = new Button();
            statusStrip1 = new StatusStrip();
            TSStatusLabelRecCount = new ToolStripStatusLabel();
            panelPageControl = new Panel();
            label11 = new Label();
            comboBox1 = new ComboBox();
            dataGridViewQueryResult = new DataGridView();
            eBillsSQLToolsBindingSource = new BindingSource(components);
            panel1.SuspendLayout();
            statusStrip1.SuspendLayout();
            panelPageControl.SuspendLayout();
            ((ISupportInitialize)dataGridViewQueryResult).BeginInit();
            ((ISupportInitialize)eBillsSQLToolsBindingSource).BeginInit();
            SuspendLayout();
            // 
            // panel1
            // 
            panel1.Controls.Add(button1);
            panel1.Controls.Add(buttonReset);
            panel1.Controls.Add(dateTimePickerEnd);
            panel1.Controls.Add(dateTimePickerStar);
            panel1.Controls.Add(label9);
            panel1.Controls.Add(label10);
            panel1.Controls.Add(textBoxTotalAmWithoutTax);
            panel1.Controls.Add(label8);
            panel1.Controls.Add(textBoxotalTaxAm);
            panel1.Controls.Add(label7);
            panel1.Controls.Add(comboBoxTaxpayerType);
            panel1.Controls.Add(label6);
            panel1.Controls.Add(comboBoxGeneralOrSpecialVAT);
            panel1.Controls.Add(label5);
            panel1.Controls.Add(comboBoxInIssuType);
            panel1.Controls.Add(label4);
            panel1.Controls.Add(textBoxSellerName);
            panel1.Controls.Add(label3);
            panel1.Controls.Add(textBoxSellerIdNum);
            panel1.Controls.Add(label2);
            panel1.Controls.Add(textBoxEIid);
            panel1.Controls.Add(label1);
            panel1.Dock = DockStyle.Top;
            panel1.Location = new Point(0, 0);
            panel1.Name = "panel1";
            panel1.Size = new Size(811, 150);
            panel1.TabIndex = 0;
            // 
            // buttonReset
            // 
            buttonReset.Font = new Font("Microsoft YaHei UI", 9F, FontStyle.Regular, GraphicsUnit.Point, 134);
            buttonReset.Image = Properties.Resources.skyblue_view_refresh;
            buttonReset.ImageAlign = ContentAlignment.MiddleLeft;
            buttonReset.Location = new Point(641, 76);
            buttonReset.Margin = new Padding(0);
            buttonReset.Name = "buttonReset";
            buttonReset.Size = new Size(149, 23);
            buttonReset.TabIndex = 22;
            buttonReset.Text = "复    位";
            buttonReset.UseVisualStyleBackColor = true;
            buttonReset.Click += buttonReset_Click;
            // 
            // dateTimePickerEnd
            // 
            dateTimePickerEnd.CustomFormat = "yyyy-MM-dd";
            dateTimePickerEnd.Format = DateTimePickerFormat.Custom;
            dateTimePickerEnd.Location = new Point(641, 41);
            dateTimePickerEnd.MaxDate = new DateTime(2100, 12, 31, 0, 0, 0, 0);
            dateTimePickerEnd.MinDate = new DateTime(2020, 1, 1, 0, 0, 0, 0);
            dateTimePickerEnd.Name = "dateTimePickerEnd";
            dateTimePickerEnd.Size = new Size(149, 25);
            dateTimePickerEnd.TabIndex = 21;
            dateTimePickerEnd.Value = new DateTime(2024, 1, 1, 10, 43, 0, 0);
            // 
            // dateTimePickerStar
            // 
            dateTimePickerStar.CustomFormat = "yyyy-MM-dd";
            dateTimePickerStar.Format = DateTimePickerFormat.Custom;
            dateTimePickerStar.Location = new Point(641, 7);
            dateTimePickerStar.MaxDate = new DateTime(2100, 12, 31, 0, 0, 0, 0);
            dateTimePickerStar.MinDate = new DateTime(2020, 1, 1, 0, 0, 0, 0);
            dateTimePickerStar.Name = "dateTimePickerStar";
            dateTimePickerStar.Size = new Size(149, 25);
            dateTimePickerStar.TabIndex = 20;
            dateTimePickerStar.Value = new DateTime(2024, 1, 1, 10, 43, 0, 0);
            // 
            // label9
            // 
            label9.AutoSize = true;
            label9.Location = new Point(556, 43);
            label9.Name = "label9";
            label9.Size = new Size(79, 20);
            label9.TabIndex = 18;
            label9.Text = "开票日期 ≤";
            // 
            // label10
            // 
            label10.AutoSize = true;
            label10.Location = new Point(556, 9);
            label10.Name = "label10";
            label10.Size = new Size(79, 20);
            label10.TabIndex = 16;
            label10.Text = "开票日期 >";
            // 
            // textBoxTotalAmWithoutTax
            // 
            textBoxTotalAmWithoutTax.Location = new Point(395, 109);
            textBoxTotalAmWithoutTax.Name = "textBoxTotalAmWithoutTax";
            textBoxTotalAmWithoutTax.Size = new Size(147, 25);
            textBoxTotalAmWithoutTax.TabIndex = 15;
            // 
            // label8
            // 
            label8.AutoSize = true;
            label8.Location = new Point(324, 111);
            label8.Name = "label8";
            label8.Size = new Size(65, 20);
            label8.TabIndex = 14;
            label8.Text = "无税金额";
            // 
            // textBoxotalTaxAm
            // 
            textBoxotalTaxAm.Location = new Point(395, 75);
            textBoxotalTaxAm.Name = "textBoxotalTaxAm";
            textBoxotalTaxAm.Size = new Size(147, 25);
            textBoxotalTaxAm.TabIndex = 13;
            // 
            // label7
            // 
            label7.AutoSize = true;
            label7.Location = new Point(352, 77);
            label7.Name = "label7";
            label7.Size = new Size(37, 20);
            label7.TabIndex = 12;
            label7.Text = "税额";
            // 
            // comboBoxTaxpayerType
            // 
            comboBoxTaxpayerType.DropDownStyle = ComboBoxStyle.DropDownList;
            comboBoxTaxpayerType.FormattingEnabled = true;
            comboBoxTaxpayerType.Items.AddRange(new object[] { "一般纳税人", "小规模纳税人" });
            comboBoxTaxpayerType.Location = new Point(94, 106);
            comboBoxTaxpayerType.Name = "comboBoxTaxpayerType";
            comboBoxTaxpayerType.Size = new Size(147, 28);
            comboBoxTaxpayerType.TabIndex = 11;
            // 
            // label6
            // 
            label6.AutoSize = true;
            label6.Location = new Point(12, 111);
            label6.Name = "label6";
            label6.Size = new Size(79, 20);
            label6.TabIndex = 10;
            label6.Text = "纳税人类型";
            // 
            // comboBoxGeneralOrSpecialVAT
            // 
            comboBoxGeneralOrSpecialVAT.DropDownStyle = ComboBoxStyle.DropDownList;
            comboBoxGeneralOrSpecialVAT.FormattingEnabled = true;
            comboBoxGeneralOrSpecialVAT.Items.AddRange(new object[] { "专用发票", "普通发票" });
            comboBoxGeneralOrSpecialVAT.Location = new Point(94, 72);
            comboBoxGeneralOrSpecialVAT.Name = "comboBoxGeneralOrSpecialVAT";
            comboBoxGeneralOrSpecialVAT.Size = new Size(147, 28);
            comboBoxGeneralOrSpecialVAT.TabIndex = 9;
            // 
            // label5
            // 
            label5.AutoSize = true;
            label5.Location = new Point(12, 77);
            label5.Name = "label5";
            label5.Size = new Size(79, 20);
            label5.TabIndex = 8;
            label5.Text = "增值税类型";
            // 
            // comboBoxInIssuType
            // 
            comboBoxInIssuType.DropDownStyle = ComboBoxStyle.DropDownList;
            comboBoxInIssuType.FormattingEnabled = true;
            comboBoxInIssuType.Items.AddRange(new object[] { "红字发票", "蓝字发票" });
            comboBoxInIssuType.Location = new Point(94, 39);
            comboBoxInIssuType.Name = "comboBoxInIssuType";
            comboBoxInIssuType.Size = new Size(147, 28);
            comboBoxInIssuType.TabIndex = 7;
            // 
            // label4
            // 
            label4.AutoSize = true;
            label4.Location = new Point(12, 43);
            label4.Name = "label4";
            label4.Size = new Size(65, 20);
            label4.TabIndex = 6;
            label4.Text = "票据类型";
            // 
            // textBoxSellerName
            // 
            textBoxSellerName.Location = new Point(395, 41);
            textBoxSellerName.Name = "textBoxSellerName";
            textBoxSellerName.Size = new Size(147, 25);
            textBoxSellerName.TabIndex = 5;
            // 
            // label3
            // 
            label3.AutoSize = true;
            label3.Location = new Point(310, 43);
            label3.Name = "label3";
            label3.Size = new Size(79, 20);
            label3.TabIndex = 4;
            label3.Text = "销售方名称";
            // 
            // textBoxSellerIdNum
            // 
            textBoxSellerIdNum.Location = new Point(395, 7);
            textBoxSellerIdNum.Name = "textBoxSellerIdNum";
            textBoxSellerIdNum.Size = new Size(147, 25);
            textBoxSellerIdNum.TabIndex = 3;
            // 
            // label2
            // 
            label2.AutoSize = true;
            label2.Location = new Point(268, 9);
            label2.Name = "label2";
            label2.Size = new Size(121, 20);
            label2.TabIndex = 2;
            label2.Text = "销售方纳税识别号";
            // 
            // textBoxEIid
            // 
            textBoxEIid.Location = new Point(94, 7);
            textBoxEIid.Name = "textBoxEIid";
            textBoxEIid.Size = new Size(147, 25);
            textBoxEIid.TabIndex = 1;
            // 
            // label1
            // 
            label1.AutoSize = true;
            label1.Location = new Point(12, 9);
            label1.Name = "label1";
            label1.Size = new Size(65, 20);
            label1.TabIndex = 0;
            label1.Text = "票据编号";
            // 
            // button1
            // 
            button1.Font = new Font("Microsoft YaHei UI", 9F, FontStyle.Regular, GraphicsUnit.Point, 134);
            button1.Image = Properties.Resources.green_go_down;
            button1.ImageAlign = ContentAlignment.MiddleLeft;
            button1.Location = new Point(641, 111);
            button1.Margin = new Padding(0);
            button1.Name = "button1";
            button1.Size = new Size(149, 23);
            button1.TabIndex = 23;
            button1.Text = "查   询";
            button1.UseVisualStyleBackColor = true;
            // 
            // statusStrip1
            // 
            statusStrip1.AutoSize = false;
            statusStrip1.Items.AddRange(new ToolStripItem[] { TSStatusLabelRecCount });
            statusStrip1.Location = new Point(0, 534);
            statusStrip1.Name = "statusStrip1";
            statusStrip1.Size = new Size(811, 25);
            statusStrip1.TabIndex = 1;
            statusStrip1.Text = "statusStrip1";
            // 
            // TSStatusLabelRecCount
            // 
            TSStatusLabelRecCount.AutoSize = false;
            TSStatusLabelRecCount.ImageScaling = ToolStripItemImageScaling.None;
            TSStatusLabelRecCount.Name = "TSStatusLabelRecCount";
            TSStatusLabelRecCount.Size = new Size(150, 20);
            TSStatusLabelRecCount.Text = "RecCount=50000";
            TSStatusLabelRecCount.TextAlign = ContentAlignment.MiddleLeft;
            // 
            // panelPageControl
            // 
            panelPageControl.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
            panelPageControl.Controls.Add(comboBox1);
            panelPageControl.Controls.Add(label11);
            panelPageControl.Font = new Font("Microsoft YaHei UI", 9F, FontStyle.Regular, GraphicsUnit.Point, 134);
            panelPageControl.Location = new Point(504, 537);
            panelPageControl.Name = "panelPageControl";
            panelPageControl.Size = new Size(284, 26);
            panelPageControl.TabIndex = 2;
            // 
            // label11
            // 
            label11.Dock = DockStyle.Left;
            label11.Location = new Point(0, 0);
            label11.Name = "label11";
            label11.Size = new Size(209, 26);
            label11.TabIndex = 0;
            label11.Text = "共{0}页(第{1}页) 当前页：";
            label11.TextAlign = ContentAlignment.MiddleRight;
            // 
            // comboBox1
            // 
            comboBox1.DropDownStyle = ComboBoxStyle.DropDownList;
            comboBox1.FormattingEnabled = true;
            comboBox1.Location = new Point(205, 1);
            comboBox1.Name = "comboBox1";
            comboBox1.Size = new Size(74, 25);
            comboBox1.TabIndex = 3;
            comboBox1.SelectedIndexChanged += comboBox1_SelectedIndexChanged;
            // 
            // dataGridViewQueryResult
            // 
            dataGridViewQueryResult.AllowUserToAddRows = false;
            dataGridViewQueryResult.AllowUserToDeleteRows = false;
            dataGridViewQueryResult.AllowUserToOrderColumns = true;
            dataGridViewQueryResult.AllowUserToResizeRows = false;
            dataGridViewQueryResult.AutoGenerateColumns = false;
            dataGridViewQueryResult.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
            dataGridViewQueryResult.DataSource = eBillsSQLToolsBindingSource;
            dataGridViewQueryResult.Dock = DockStyle.Fill;
            dataGridViewQueryResult.Location = new Point(0, 150);
            dataGridViewQueryResult.MultiSelect = false;
            dataGridViewQueryResult.Name = "dataGridViewQueryResult";
            dataGridViewQueryResult.ReadOnly = true;
            dataGridViewQueryResult.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
            dataGridViewQueryResult.Size = new Size(811, 384);
            dataGridViewQueryResult.TabIndex = 3;
            // 
            // eBillsSQLToolsBindingSource
            // 
            eBillsSQLToolsBindingSource.DataSource = typeof(EBillsSQLTools);
            // 
            // FEBillQuery
            // 
            AutoScaleMode = AutoScaleMode.None;
            ClientSize = new Size(811, 559);
            Controls.Add(dataGridViewQueryResult);
            Controls.Add(panelPageControl);
            Controls.Add(statusStrip1);
            Controls.Add(panel1);
            Font = new Font("Microsoft YaHei UI", 10.5F, FontStyle.Regular, GraphicsUnit.Point, 134);
            Icon = (Icon)resources.GetObject("$this.Icon");
            Name = "FEBillQuery";
            StartPosition = FormStartPosition.CenterScreen;
            Text = "电子票据查询工具";
            panel1.ResumeLayout(false);
            panel1.PerformLayout();
            statusStrip1.ResumeLayout(false);
            statusStrip1.PerformLayout();
            panelPageControl.ResumeLayout(false);
            ((ISupportInitialize)dataGridViewQueryResult).EndInit();
            ((ISupportInitialize)eBillsSQLToolsBindingSource).EndInit();
            ResumeLayout(false);
        }

        public void ResetAll(int iKey = 0)
        {
            if (iKey == 0)
            {
                textBoxEIid.Text = string.Empty;
                textBoxotalTaxAm.Text = string.Empty;
                textBoxSellerIdNum.Text = string.Empty;
                textBoxSellerName.Text = string.Empty;
                textBoxTotalAmWithoutTax.Text = string.Empty;
                comboBoxInIssuType.SelectedIndex = 1;
                comboBoxTaxpayerType.SelectedIndex = 0;
                comboBoxGeneralOrSpecialVAT.SelectedIndex = 0;
                dateTimePickerEnd.Value = DateTime.Now;
            }
        }

        private void buttonReset_Click(object sender, EventArgs e)
        {
            ResetAll();
        }

        private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {

        }
    }
}
